package com.innovation.chengzhangriji.ui;

import android.content.pm.PackageManager;
import android.os.Bundle;

/**
 * 照相机基类活动
 */
public abstract class BaseCameraActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        checkCameraHardware();
    }

    /**
     * 没有照相机
     */
    protected void noCamera() {
        finish();
    }

    private void checkCameraHardware() {
        if (!getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
            noCamera();
        }
    }

}
